-- Table contacts_skype
CREATE TABLE [contacts_skype]
(
 [id_contanct_skype] Int IDENTITY(1,1) NOT NULL,
 [account_name_skype] Varchar(max) NULL,
 [id_person] Int NOT NULL
)
go

-- Add keys for table contacts_skype
ALTER TABLE [contacts_skype] ADD CONSTRAINT [contacts_skype_pk] PRIMARY KEY ([id_contanct_skype])
go

ALTER TABLE [contacts_skype] ADD CONSTRAINT [account_name_skype] UNIQUE CLUSTERED ([account_name_skype])
go

-- Table contacts_seznam
CREATE TABLE [contacts_seznam]
(
 [id_contact_seznam] Int IDENTITY(1,1) NOT NULL,
 [account_name_seznam] Varchar(max) NULL,
 [id_person] Int NOT NULL
)
go

-- Add keys for table contacts_seznam
ALTER TABLE [contacts_seznam] ADD CONSTRAINT [contacts_seznam_pk] PRIMARY KEY ([id_contact_seznam])
go

ALTER TABLE [contacts_seznam] ADD CONSTRAINT [account_name_seznam] UNIQUE CLUSTERED ([account_name_seznam])
go

-- Create relationships section -------------------------------------------------
ALTER TABLE [contacts_skype] ADD CONSTRAINT [people_skype] FOREIGN KEY ([id_person]) REFERENCES [people] ([id_person])
go

ALTER TABLE [contacts_seznam] ADD CONSTRAINT [people_seznam] FOREIGN KEY ([id_person]) REFERENCES [people] ([id_person])
go




